aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-083/daniel-mita/raku/ch-2.raku12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-083/daniel-mita/raku/ch-2.raku b/challenge-083/daniel-mita/raku/ch-2.raku
new file mode 100755
index 0000000000..ed5730718d
--- /dev/null
+++ b/challenge-083/daniel-mita/raku/ch-2.raku
@@ -0,0 +1,12 @@
+#!/usr/bin/env raku
+
+sub MAIN(
+ *@positive-ints where { .elems > 0 && .all ~~ Int && .all > 0 }
+ --> Nil
+) {
+ @(
+ @positive-ints.combinations(1..*)
+ .grep( *.sum ≤ @positive-ints.sum / 2 )
+ .sort({ $^b.sum <=> $^a.sum || $a.elems <=> $b.elems })
+ )[0].elems.say;
+}