Exactly three adjacent 3 in lists: Difference between revisions

m
m (→‎{{header|Raku}}: Generalized)
m (→‎{{header|Raku}}: white space)
Line 64:
=={{header|Raku}}==
Generalized
<lang perl6>for 1 .. 4 -> $n {
 
say "\nExactly $n {$n}s, and they are consecutive:";
 
say .gist, ' ', lc (.Bag{$n} == $n) && ( so .rotor($n=>-($n - 1)).grep: *.all == $n ) for
[9,3,3,3,2,1,7,8,5],
10,339

edits