adventofcode/2016/06/2.pl
Yanick Champoux 9e72485aad 2016-06
2017-12-28 14:49:32 -05:00

21 lines
277 B
Perl

use 5.20.0;
use List::UtilsBy qw/ max_by min_by /;
my @message;
while(<>) {
chomp;
my @letters = split '';
while( my( $i, $l ) = each @letters ) {
$message[$i]{$l}++;
}
}
use DDP;
for my $m ( @message ) {
print min_by { $m->{$_} } keys %$m;
}