Rare numbers: Difference between revisions

m
→‎{{header|Rust}}: fix typo and revert a change
(→‎{{header|Raku}}: add alternative)
m (→‎{{header|Rust}}: fix typo and revert a change)
Line 5,469:
let diffs1: Vec<i8> = vec![0, 1, 4, 5, 6];
 
// all possible digits pairs to calaculatecalculate potential diffs
let pairs = (0_i8..=9)
.cartesian_product(0_i8..=9)
Line 5,503:
.collect::<Vec<u64>>();
 
// create a cartesian product for all potetentialpotential diff numbers
// for the first use the very short one, for all other the complete 19 element
let diff_list_iter = (0_u8..(d / 2))
Line 5,521:
(a, b) if (a == 4 && ![-8, -6, -4, -2, 0, 2, 4, 6, 8].contains(&b)) => false,
(a, b) if (a == 5 && ![7, -3].contains(&b)) => false,
(a, b) if (a == 6 && ![-9, -7, -5, -3, -1, 1, 3, 5, 7, 9].contains(&b)) => false,{
false
}
_ => true,
}
350

edits