From 5ea9537a28ed490439fcc2f9d8bd062903bf045b Mon Sep 17 00:00:00 2001 From: Scimon Date: Mon, 29 Nov 2021 09:58:26 +0000 Subject: Challenge 2 --- challenge-141/simon-proctor/raku/ch-2.raku | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 challenge-141/simon-proctor/raku/ch-2.raku 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; +} -- cgit