2 ms·
And because I couldn't resist, here's a one-liner (for calculations, anyway) version: my %count := (1..*).grep(*.is-prime).map(* % 10).rotor(2 => -1).map(~
by colomon 11y ago
And because I couldn't resist, here's a one-liner (for calculations, anyway) version:
my %count := (1..*).grep(*.is-prime).map(* % 10).rotor(2 => -1).map(~*)[^100000].Bag;
I think it's a bit slower than my previous version. (And much slower than the Rust version posted elsewhere here!)