]> www.fi.muni.cz Git - aoc.git/blob - 2016/12.pl
Day 25: examining the input
[aoc.git] / 2016 / 12.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use v5.30;
5
6 my %h;
7 while (<>) {
8         chomp;
9         my $i = 0;
10         for my $l (split //) {
11                 $h{$i++}{$l}++;
12         }
13 }
14
15 my $p;
16
17 for my $i (0..7) {
18         my @a = sort { $h{$i}{$b} <=> $h{$i}{$a} } keys %{ $h{$i} };
19         $p .= $a[-1];
20 }
21
22 say $p;
23                 
24