Mbpp/736

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
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 失败测试用例
  • 无失败测试