aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-09-21 11:02:02 +0100
committerGitHub <noreply@github.com>2025-09-21 11:02:02 +0100
commit7fb2c6d54f1d78502c9f79a35f8d03217fe6cd3c (patch)
tree9417fcda6408129c070292c7bb3602b4fb3f70dc
parent75acf511270cc4df6d1b59fdd27a072fcf8d5b20 (diff)
parent5894f49985db1c649d1a945ab7ee791f4b6ef17c (diff)
downloadperlweeklychallenge-club-7fb2c6d54f1d78502c9f79a35f8d03217fe6cd3c.tar.gz
perlweeklychallenge-club-7fb2c6d54f1d78502c9f79a35f8d03217fe6cd3c.tar.bz2
perlweeklychallenge-club-7fb2c6d54f1d78502c9f79a35f8d03217fe6cd3c.zip
Merge pull request #12702 from wambash/challenge-week-339
solution week 339-2
-rw-r--r--challenge-339/wambash/raku/ch-2.raku20
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-339/wambash/raku/ch-2.raku b/challenge-339/wambash/raku/ch-2.raku
new file mode 100644
index 0000000000..bf22a0689a
--- /dev/null
+++ b/challenge-339/wambash/raku/ch-2.raku
@@ -0,0 +1,20 @@
+#!/usr/bin/env raku
+
+sub peak-point (+gain) {
+ max [\+] 0, |gain
+
+}
+
+multi MAIN (Bool :test($)!) {
+ use Test;
+ is peak-point(-5, 1, 5, -9, 2), 1;
+ is peak-point(10,10,10,-25), 30;
+ is peak-point(3, -4, 2, 5, -6, 1), 6;
+ is peak-point(-1, -2, -3, -4), 0;
+ is peak-point(-10, 15, 5), 10;
+ done-testing;
+}
+
+multi MAIN (+gain) {
+ say peak-point gain;
+}