Skip to main content

count_distinct_in_range

Function count_distinct_in_range 

Source
pub fn count_distinct_in_range<T: Eq + Hash + Copy>(
    a: &[T],
    queries: &[Query],
) -> Vec<usize>
Expand description

Solve “number of distinct values in range” queries using Mo’s algorithm.

a is the value array; queries are the half-open intervals. Returns one answer per query.