aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScimon <simon.proctor@gmail.com>2021-11-29 09:58:26 +0000
committerScimon <simon.proctor@gmail.com>2021-11-29 09:58:26 +0000
commit5ea9537a28ed490439fcc2f9d8bd062903bf045b (patch)
treea9322285c5b37bfe3c0089fa7feeaae1aa70100b
parent8c3b72aa23fe2ca60dbcf176dca5b7f9548673d4 (diff)
downloadperlweeklychallenge-club-5ea9537a28ed490439fcc2f9d8bd062903bf045b.tar.gz
perlweeklychallenge-club-5ea9537a28ed490439fcc2f9d8bd062903bf045b.tar.bz2
perlweeklychallenge-club-5ea9537a28ed490439fcc2f9d8bd062903bf045b.zip
Challenge 2
-rw-r--r--challenge-141/simon-proctor/raku/ch-2.raku9
1 files changed, 9 insertions, 0 deletions
diff --git a/challenge-141/simon-proctor/raku/ch-2.raku b/challenge-141/simon-proctor/raku/ch-2.raku
new file mode 100644
index 0000000000..1bb40b5556
--- /dev/null
+++ b/challenge-141/simon-proctor/raku/ch-2.raku
@@ -0,0 +1,9 @@
+#!/usr/bin/env raku
+
+#| Given a two number M and N find the number of "Like Numbers" can be found
+sub MAIN (
+ UInt \M, #= Integer used to make sub values
+ UInt \N #= Integer subvales of M should be divisible by
+) {
+ M.comb.combinations(1..^(M.codes)).map( *.join() ).grep( * %% N ).elems.say;
+}