aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-05-11 17:28:22 +0100
committerGitHub <noreply@github.com>2020-05-11 17:28:22 +0100
commit1cbe3a708adde2c98a2b56dc1a61055801ff06b5 (patch)
treeaa63a50a6a85a8beaae1b67f21b65613e94bf999
parenta69e4941ff6df621e57ce67f792875aff37ffca6 (diff)
parentdc179ba5f7a9f868a037617bc6c62a4696fe5dec (diff)
downloadperlweeklychallenge-club-1cbe3a708adde2c98a2b56dc1a61055801ff06b5.tar.gz
perlweeklychallenge-club-1cbe3a708adde2c98a2b56dc1a61055801ff06b5.tar.bz2
perlweeklychallenge-club-1cbe3a708adde2c98a2b56dc1a61055801ff06b5.zip
Merge pull request #1700 from sangeetkar/branch60
Solutions to Challenge060
-rw-r--r--challenge-060/sangeet-kar/perl/ch-1.sh1
-rw-r--r--challenge-060/sangeet-kar/perl/ch-2.pl12
2 files changed, 13 insertions, 0 deletions
diff --git a/challenge-060/sangeet-kar/perl/ch-1.sh b/challenge-060/sangeet-kar/perl/ch-1.sh
new file mode 100644
index 0000000000..9da2537a4e
--- /dev/null
+++ b/challenge-060/sangeet-kar/perl/ch-1.sh
@@ -0,0 +1 @@
+perl -E '$xcol="A"; for (1..16384) {$xcol_num{$xcol}=$_; $num_xcol{$_}=$xcol; $xcol++}; say /\d+/ ? $num_xcol{$_} : $xcol_num{$_} for (shift)'
diff --git a/challenge-060/sangeet-kar/perl/ch-2.pl b/challenge-060/sangeet-kar/perl/ch-2.pl
new file mode 100644
index 0000000000..47601db42f
--- /dev/null
+++ b/challenge-060/sangeet-kar/perl/ch-2.pl
@@ -0,0 +1,12 @@
+use 5.30.0;
+use warnings;
+use Algorithm::Combinatorics qw(variations_with_repetition);
+
+sub solve {
+ my ($listref, $k, $limit) = @_;
+ say join ', ',
+ grep /^[^0]+/ && $_ < $limit,
+ map join('', @$_), variations_with_repetition ($listref, $k);
+}
+
+solve ([0, 1, 2, 5], 2, 21); \ No newline at end of file