Skip to main content
deleted 360 characters in body
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl 5, 2424 22 bytes

Includes +1+2 for -ala

perl -aE '/$/;map$_<$`||//+say,@F' <<< "-1 2 5 4 3 7 7"

Try it online!

Under codegolf style 2018 scoring this would be 22:

#!/usr/bin/perl -ala
//;map$_<$'||//+say,@F$_<"$o $_"||say$o=$_

Try it online!Try it online!

Perl 5, 24 bytes

Includes +1 for -a

perl -aE '/$/;map$_<$`||//+say,@F' <<< "-1 2 5 4 3 7 7"

Try it online!

Under codegolf style 2018 scoring this would be 22:

#!/usr/bin/perl -a
//;map$_<$'||//+say,@F

Try it online!

Perl 5, 24 22 bytes

Includes +2 for -la

#!/usr/bin/perl -la
$_<"$o $_"||say$o=$_

Try it online!

Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl 5, 24 bytes

Includes +1 for -a

perl -aE '/$/;map$_<$`||//+say,@F' <<< "-1 2 5 4 3 7 7"

Try it online!

Under codegolf style 2018 scoring this would be 22:

#!/usr/bin/perl -a
//;map$_<$'||//+say,@F

Try it online!