dsalgo 0.3.10

A package for Datastructures and Algorithms.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::greatest_common_divisor_euclidean::gcd;

pub fn is_setwise_coprime(a: &[usize]) -> bool {
    a.to_vec().into_iter().reduce(gcd).unwrap() == 1
}

#[cfg(test)]

mod tests {

    use super::*;

    #[test]

    fn test() {
        assert!(is_setwise_coprime(&[6, 10, 15]));
    }
}