aboutsummaryrefslogtreecommitdiff
path: root/challenge-078
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-078')
-rwxr-xr-xchallenge-078/anton-fedotov/perl/ch-1.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-078/anton-fedotov/perl/ch-1.pl b/challenge-078/anton-fedotov/perl/ch-1.pl
new file mode 100755
index 0000000000..32ee61686f
--- /dev/null
+++ b/challenge-078/anton-fedotov/perl/ch-1.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use v5.30;
+
+my @A = @ARGV;
+@A = (9, 10, 7, 5, 6, 1) unless @A;
+my @L;
+
+eval {state$i=0;push @L, $_ if $_ == shift @{[sort {$b <=> $a} @A[$i++..$#A]]}} for @A;
+
+say join ',', @L;