adventofcode/2015/02/wrapping_2.pl
Yanick Champoux 115e014fe1 day2
2017-12-03 19:57:32 -05:00

13 lines
227 B
Perl

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' ]} <>;