adventofcode/2015/02/wrapping_2.pl

13 lines
227 B
Perl
Raw Normal View History

2017-12-04 00:57:32 +00:00
use 5.20.0;
use Algorithm::Combinatorics qw( combinations );
use List::AllUtils qw/ sum min product /;
my $total;
say sum
map { 2 * ( $_->[0] + $_->[1] ), product @$_ }
map {[ sort { $a <=> $b } split 'x' ]} <>;