Isograms and heterograms: Difference between revisions

m
(→‎{{header|Raku}}: Add a Raku example)
m (→‎{{header|Raku}}: concurrency)
Line 140:
<lang perl6>my $file = 'unixdict.txt';
 
my @words = $file.IO.slurp.words.race.map: { $_ => .comb.Bag };
 
.say for (6...2).map: -> $n {
next unless my @iso = @words.race.grep({.value.values.all == $n}).map: *».key;
say "\n({+@iso}) {$n}-isograms:\n" ~ @iso.sort({[-.chars, ~$_]}).join: "\n";
}
 
Line 151:
say "\n({+$_}) heterograms with $minchars or more characters:\n" ~
.sort({[-.chars, ~$_]}).join: "\n" given
@words.race.grep({.key.chars >$minchars && .value.values.max == 1})».key;</lang>
{{out}}
<pre>(2) 3-isograms:
10,333

edits