diff options
-rw-r--r-- | day10.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/day10.pl b/day10.pl new file mode 100644 index 0000000..5061bcd --- /dev/null +++ b/day10.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w +use v5.16; + +use File::Slurper 'read_lines'; +use List::Util qw'max uniq'; +use Math::Complex; + +my @as; +my @l = read_lines('day10t'); +while (my ($x, $l) = each(@l)) { + my @c = split('', $l); + while (my ($y, $c) = each(@c)) { + push @as, cplx($x, $y) if $c eq "#"; + } +} + +say max map { my $a = $_; scalar uniq map { arg($a - $_) } @as } @as; +# 288 + +# Part 2 TBD +# 616 |