aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-195/mark-anderson/raku/ch-1.raku8
1 files changed, 6 insertions, 2 deletions
diff --git a/challenge-195/mark-anderson/raku/ch-1.raku b/challenge-195/mark-anderson/raku/ch-1.raku
index 32539e82ae..f71c30c3b8 100644
--- a/challenge-195/mark-anderson/raku/ch-1.raku
+++ b/challenge-195/mark-anderson/raku/ch-1.raku
@@ -7,12 +7,16 @@ is special-integers(9_999_999), 712890;
sub special-integers($n)
{
- .elems given gather for (^10).combinations(1..$n.chars)
+ my $i;
+
+ for (^10).combinations(1..$n.chars)
{
for .permutations
{
next unless .head;
- .take unless $_ > $n given .join
+ $i++ unless $_ > $n given .join
}
}
+
+ $i
}