测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 406 字符 |
模型生成的代码 (406 字符)
def left_insertion(arr, val):
"""
Returns the left insertion point for val in a sorted list arr.
The left insertion point is the index of the first element >= val.
If all elements are < val, returns len(arr).
"""
lo, hi = 0, len(arr)
while lo < hi:
mid = (lo + hi) // 2
if arr[mid] < val:
lo = mid + 1
else:
hi = mid
return lo
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试