aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-252/mark-anderson/raku/ch-2.raku5
1 files changed, 2 insertions, 3 deletions
diff --git a/challenge-252/mark-anderson/raku/ch-2.raku b/challenge-252/mark-anderson/raku/ch-2.raku
index 873a46dbdd..3e398a8e1e 100644
--- a/challenge-252/mark-anderson/raku/ch-2.raku
+++ b/challenge-252/mark-anderson/raku/ch-2.raku
@@ -3,14 +3,13 @@ use Test;
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(2), (-1,1);
is-deeply uniq-sum-zero(1), (0,);
is-deeply uniq-sum-zero(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 where * > 1)
+sub uniq-sum-zero($n)
{
my $i = $n div 2;
(-$i...-1,1,2,3...$i,0)[^$n]