adventofcode/14/1.pl

15 lines
238 B
Perl
Raw Normal View History

2017-12-14 18:58:00 +00:00
use 5.20.0;
use lib '.';
use hash;
my $key = 'stpzcrnm';
use List::AllUtils qw/ sum /;
say sum
map { split '' }
map { sprintf "%04b", $_ }
map { hex }
map { split '' }
map { knot_hash( join '-', $key, $_) } 0..127;