aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-326/ash/raku/ch-1.raku6
-rw-r--r--challenge-326/ash/raku/ch-2.raku12
2 files changed, 18 insertions, 0 deletions
diff --git a/challenge-326/ash/raku/ch-1.raku b/challenge-326/ash/raku/ch-1.raku
new file mode 100644
index 0000000000..81ec31b2a9
--- /dev/null
+++ b/challenge-326/ash/raku/ch-1.raku
@@ -0,0 +1,6 @@
+# Solution to the Task 1 of the Weekly Challenge 326
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-326/#TASK1
+
+say DateTime.new('2025-02-02').day-of-year; # 33
+say DateTime.new('2025-04-10').day-of-year; # 100
+say DateTime.new('2025-09-07').day-of-year; # 250
diff --git a/challenge-326/ash/raku/ch-2.raku b/challenge-326/ash/raku/ch-2.raku
new file mode 100644
index 0000000000..f471463392
--- /dev/null
+++ b/challenge-326/ash/raku/ch-2.raku
@@ -0,0 +1,12 @@
+# Solution to the Task 2 of the Weekly Challenge 326
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-326/#TASK2
+
+say decompress(1, 3, 2, 4); # 3 4 4
+say decompress(1, 1, 2, 2); # 1 2 2
+say decompress(3, 1, 3, 2); # 1 1 1 2 2 2
+
+sub decompress(*@list) {
+ (gather for @list -> $repetitions, $value {
+ take $value xx $repetitions;
+ }).flat
+}