aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-335/ash/raku/ch-1.raku12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-335/ash/raku/ch-1.raku b/challenge-335/ash/raku/ch-1.raku
new file mode 100644
index 0000000000..d9083ea905
--- /dev/null
+++ b/challenge-335/ash/raku/ch-1.raku
@@ -0,0 +1,12 @@
+# Task 1 of the Weekly Challenge 335
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-335/#TASK1
+
+say find-common('bella', 'label', 'roller'); # Bag(e l(2))
+say find-common('cool', 'lock', 'cook'); # Bag(c o)
+say find-common('hello', 'world', 'pole'); # Bag(l o)
+say find-common('abc', 'def', 'ghi'); # Bag()
+say find-common('aab', 'aac', 'aaa'); # Bag(a(2))
+
+sub find-common(*@words) {
+ [∩] @words.map: *.comb.Bag
+}