This commit is contained in:
Yanick Champoux 2017-12-01 20:28:26 -05:00
parent f4aba7ad51
commit ea12a2762e
2 changed files with 18 additions and 0 deletions

9
day1/day1.pl Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env perl -n
use 5.20.0;
use List::AllUtils qw/ sum /;
chomp;
$_ .= substr $_, 0, 1;
say sum /(.)(?=\1)/g;

9
day1/day1b.pl Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env perl -n
use 5.20.0;
use List::AllUtils qw/ sum /;
chomp;
my @n = split '';
say sum @n[ grep { $n[$_] == $n[($_+@n/2)%@n] } 0..$#n ]