aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-252/mark-anderson/raku/ch-1.raku1
-rw-r--r--challenge-252/mark-anderson/raku/ch-2.raku15
2 files changed, 4 insertions, 12 deletions
diff --git a/challenge-252/mark-anderson/raku/ch-1.raku b/challenge-252/mark-anderson/raku/ch-1.raku
index 61ee7f19da..5de0eeaf33 100644
--- a/challenge-252/mark-anderson/raku/ch-1.raku
+++ b/challenge-252/mark-anderson/raku/ch-1.raku
@@ -8,6 +8,5 @@ is special-numbers([2,7,1,19,18,3]), 63;
sub special-numbers(@ints)
{
@ints.unshift: Any;
-
[+] @ints[divisors @ints.end] >>**>> 2
}
diff --git a/challenge-252/mark-anderson/raku/ch-2.raku b/challenge-252/mark-anderson/raku/ch-2.raku
index cfc70ac832..6083c3456f 100644
--- a/challenge-252/mark-anderson/raku/ch-2.raku
+++ b/challenge-252/mark-anderson/raku/ch-2.raku
@@ -5,20 +5,13 @@ is-deeply uniq-sum-zero(5), (-2,-1,1,2,0);
is-deeply uniq-sum-zero(3), (-1,1,0);
is-deeply uniq-sum-zero(1), (0,);
is-deeply uniq-sum-zero(0), ();
-is-deeply uniq-sum-zero(-0), ();
-is-deeply uniq-sum-zero(-1), (0,);
-is-deeply uniq-sum-zero(-8), (-4,-3,-2,-1,1,2,3,4);
-is-deeply uniq-sum-zero(-9), (-4,-3,-2,-1,1,2,3,4,0);
-
-multi uniq-sum-zero($n where 0) { () }
-
-multi uniq-sum-zero($n where 1|-1) { (0,) }
+is-deeply uniq-sum-zero(8), (-4,-3,-2,-1,1,2,3,4);
+is-deeply uniq-sum-zero(9), (-4,-3,-2,-1,1,2,3,4,0);
+multi uniq-sum-zero($n where 0) { () }
+multi uniq-sum-zero($n where 1) { (0,) }
multi uniq-sum-zero($n is copy)
{
- $n .= abs;
-
my $i = $n div 2;
-
(-$i,-$i+1...-1,1,2,3...$i,0)[^$n]
}