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