diff options
| -rw-r--r-- | challenge-067/ohmycloud/raku/ch-1.p6 | 3 | ||||
| -rw-r--r-- | challenge-067/ohmycloud/raku/ch-2.p6 | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/challenge-067/ohmycloud/raku/ch-1.p6 b/challenge-067/ohmycloud/raku/ch-1.p6 new file mode 100644 index 0000000000..10fbc21394 --- /dev/null +++ b/challenge-067/ohmycloud/raku/ch-1.p6 @@ -0,0 +1,3 @@ +sub MAIN(Int $m, Int $n) { + say (1..$m).combinations($n).grep: { [<] |$_ }; +} diff --git a/challenge-067/ohmycloud/raku/ch-2.p6 b/challenge-067/ohmycloud/raku/ch-2.p6 new file mode 100644 index 0000000000..a9dba6fbb8 --- /dev/null +++ b/challenge-067/ohmycloud/raku/ch-2.p6 @@ -0,0 +1,18 @@ +sub MAIN(Str $s) { + my %h = + 2 => 'abc', + 3 => 'def', + 4 => 'ghi', + 5 => 'jkl', + 6 => 'mno', + 7 => 'pqrs', + 8 => 'tuv', + 9 => 'wxyz'; + + my $r = $s.trans('01' => ''); + if $r.chars > 0 { + say unique [X~] %h{$r.comb}ยป.comb; + } else { + say []; + } +} |
