aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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