Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use v5.12;
- use List::Util qw(sum);
- $/ = '';
- my @elf_cal = sort {$b <=> $a} map { sum split } <>;
- say "Part 1: ", $elf_cal[0];
- say "Part 2: ", sum @elf_cal[0 .. 2];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement