aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-261/mark-anderson/raku/ch-2.raku5
1 files changed, 3 insertions, 2 deletions
diff --git a/challenge-261/mark-anderson/raku/ch-2.raku b/challenge-261/mark-anderson/raku/ch-2.raku
index 4f453b02d7..8254214c62 100644
--- a/challenge-261/mark-anderson/raku/ch-2.raku
+++ b/challenge-261/mark-anderson/raku/ch-2.raku
@@ -5,5 +5,6 @@ is multiply-by-two([5,3,6,1,12], 3), 24;
is multiply-by-two([1,2,4,3], 1), 8;
is multiply-by-two([5,6,7], 2), 2;
-multi multiply-by-two(@i, $s) { return $s }
-multi multiply-by-two(@i, $s where $s (elem) @i) { samewith(@i, $s * 2) }
+multi multiply-by-two(@i, $s) { samewith(@i.BagHash, $s) }
+multi multiply-by-two($b, $s) { return $s }
+multi multiply-by-two($b, $s where ?$b{$s}) { $b{(0..$s)}:delete; samewith($b, $s*2) }