bisect_keep_left
Find the index of the first element from the start of the array that verifies the given condition. The function is applied from the start of the array to the pivot.
def bisect_keep_left(
a: list,
fn: callable
) - > int
Find the index of the first element from the start of the array that verifies the given condition. The function is applied from the start of the array to the pivot.
Parameters
| Name | Type | Description |
|---|---|---|
| a | list | The sequence of elements to be searched. |
| fn | callable | A predicate function that accepts a slice of the array from the beginning to the current pivot and returns a boolean. |
Returns
| Type | Description |
|---|---|
int | The zero-based index of the first element that satisfies the condition, or the length of the array if no elements satisfy it. |