From 5df154bde22b3c2d7ddcc33eada6e9e3dfc01541 Mon Sep 17 00:00:00 2001 From: Ysmael Ebreo Date: Sun, 5 Jul 2020 00:36:30 +0800 Subject: Added perl solution ch#67 --- challenge-067/yet-ebreo/perl/ch-1.pl | 15 +++++++++++++++ challenge-067/yet-ebreo/perl/ch-2.pl | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 challenge-067/yet-ebreo/perl/ch-1.pl create mode 100644 challenge-067/yet-ebreo/perl/ch-2.pl diff --git a/challenge-067/yet-ebreo/perl/ch-1.pl b/challenge-067/yet-ebreo/perl/ch-1.pl new file mode 100644 index 0000000000..affdd331c4 --- /dev/null +++ b/challenge-067/yet-ebreo/perl/ch-1.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl +use strict; +use warnings; +use feature 'say'; + +use Algorithm::Combinatorics qw(combinations); + +my ($m,$n) = @ARGV; + +if (not $m && $n) { + ($m,$n) = (5,2) +} + +my @arr = (1..$m); +print "@{$_}\n" for combinations(\@arr,$n) \ No newline at end of file diff --git a/challenge-067/yet-ebreo/perl/ch-2.pl b/challenge-067/yet-ebreo/perl/ch-2.pl new file mode 100644 index 0000000000..71e7afda49 --- /dev/null +++ b/challenge-067/yet-ebreo/perl/ch-2.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl +use strict; +use feature 'say'; + + +say $_ for glob join "",map "{".qw(-,@ ABC DEF GHI JKL MNO PQRS TUV WXYZ)[$_-1]=~s/\B/,/gr."}", ($ARGV[0] || '35')=~/./g \ No newline at end of file -- cgit