aboutsummaryrefslogtreecommitdiff
path: root/challenge-050
diff options
context:
space:
mode:
authorYsmael Ebreo <Ysmael.Ebreo@latticesemi.com>2020-03-02 22:47:11 +0800
committerYsmael Ebreo <Ysmael.Ebreo@latticesemi.com>2020-03-02 22:47:11 +0800
commit5f5afa6e3ef438eaabbcbb0dbdbc8cca68beec50 (patch)
tree825fc46ca12d1183a58d67919d5b58ff952721b6 /challenge-050
parent889c0a4ed897674661b7b7a142aafb63d0778377 (diff)
downloadperlweeklychallenge-club-5f5afa6e3ef438eaabbcbb0dbdbc8cca68beec50.tar.gz
perlweeklychallenge-club-5f5afa6e3ef438eaabbcbb0dbdbc8cca68beec50.tar.bz2
perlweeklychallenge-club-5f5afa6e3ef438eaabbcbb0dbdbc8cca68beec50.zip
Added perl solution for ch#50-2
Diffstat (limited to 'challenge-050')
-rw-r--r--challenge-050/yet-ebreo/perl/ch-2.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-050/yet-ebreo/perl/ch-2.pl b/challenge-050/yet-ebreo/perl/ch-2.pl
new file mode 100644
index 0000000000..b371280c49
--- /dev/null
+++ b/challenge-050/yet-ebreo/perl/ch-2.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use feature 'say';
+
+my @list = sort {$a - $b } split " ",$ARGV[0] || "2 6 1 3";
+
+for my $i (0..~-@list) {
+ say $list[$i] if ~-@list-$i == $list[$i]
+}
+=begin
+perl .\ch-2.pl "2 6 1 3"
+2
+=cut \ No newline at end of file