aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shitov <mail@andreyshitov.com>2025-08-18 09:56:24 +0200
committerAndrew Shitov <mail@andreyshitov.com>2025-08-18 09:56:24 +0200
commit75e0981094942a8ee145b56543ad7219c3000aa4 (patch)
tree33b2a36c66e6f793ee353e3db614e2977a0f9d23
parent4f766edf1327ad3628c824c3c00f1c1f10c50b38 (diff)
downloadperlweeklychallenge-club-75e0981094942a8ee145b56543ad7219c3000aa4.tar.gz
perlweeklychallenge-club-75e0981094942a8ee145b56543ad7219c3000aa4.tar.bz2
perlweeklychallenge-club-75e0981094942a8ee145b56543ad7219c3000aa4.zip
Task 1 Week 225 solution in Raku by @ash
-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
+}