union_size

Function union_size 

Source
pub fn union_size<T>(a: &[T], b: &[T]) -> usize
Expand description

Calculates the size of the union of two sorted arrays without allocating.

This counts unique elements in the union (deduplicated).

ยงExamples

use sosorted::union_size;

let a = [1u64, 3, 5];
let b = [2u64, 3, 4];
assert_eq!(union_size(&a, &b), 5); // [1, 2, 3, 4, 5]