Skip to main content
Removed the shorter solution which didn't handle multiple pairs of the same int properly
Source Link
Xcali
  • 16.2k
  • 2
  • 15
  • 39

Perl 5 -MList::Util=pairgrep -papl, 2531 bytes

$_=!pairgrep{$a-$b}sort@F

Try it online!

Or, without the extra library:

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Perl 5 -MList::Util=pairgrep -pa, 25 bytes

$_=!pairgrep{$a-$b}sort@F

Try it online!

Or, without the extra library:

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

added 400 characters in body
Source Link
Xcali
  • 16.2k
  • 2
  • 15
  • 39

Perl 5 -plMList::Util=pairgrep -pa, 3125 bytes

$_=!pairgrep{$a-$b}sort@F

Try it online!

Or, without the extra library:

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Perl 5 -MList::Util=pairgrep -pa, 25 bytes

$_=!pairgrep{$a-$b}sort@F

Try it online!

Or, without the extra library:

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Source Link
Xcali
  • 16.2k
  • 2
  • 15
  • 39

Perl 5 -pl, 31 bytes

$k{$_}++}{$_=!grep$_-2,values%k

Try it online!