pub fn intersection<T: Clone + Eq + Hash>(a: &[T], b: &[T]) -> Vec<T>Expand description
Returns elements that are in both a and b.
ยงExample
use d3rs::array::intersection;
let a = vec![1, 2, 3, 4, 5];
let b = vec![3, 4, 5, 6, 7];
assert_eq!(intersection(&a, &b), vec![3, 4, 5]);