dsalgo/
is_setwise_coprime.rs1use crate::greatest_common_divisor_euclidean::gcd;
2
3pub fn is_setwise_coprime(a: &[usize]) -> bool {
4 a.to_vec().into_iter().reduce(gcd).unwrap() == 1
5}
6
7#[cfg(test)]
8
9mod tests {
10
11 use super::*;
12
13 #[test]
14
15 fn test() {
16 assert!(is_setwise_coprime(&[6, 10, 15]));
17 }
18}