Skip to main content

binary_search_on_answer

Function binary_search_on_answer 

Source
pub fn binary_search_on_answer(
    low: i64,
    high: i64,
    predicate: impl Fn(i64) -> bool,
    find: &str,
) -> Result<i64, Error>
Expand description

Binary search on answer for monotone predicates.

low and high are inclusive. find is "minimum" for the smallest satisfying value or "maximum" for the largest.