测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 522 字符 |
模型生成的代码 (522 字符)
def is_sublist(lst, sublst):
"""
Check whether lst contains sublst as a contiguous sublist.
Args:
lst: The main list.
sublst: The sublist to search for.
Returns:
True if sublst appears contiguously in lst, False otherwise.
An empty sublst is considered to be contained in any list.
"""
n, m = len(lst), len(sublst)
if m == 0:
return True
for i in range(n - m + 1):
if lst[i:i + m] == sublst:
return True
return False
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试