DEV Community

loading...

Discussion on: Advent of Code 2020 Solution Megathread - Day 1: Report Repair

Collapse
citizen428 profile image
Michael Kohl • Edited

I never manage to find the time for more than a handful of solutions (point in case, I just did day 1 and 2 yesterday), but I like doing them in languages I don't know well. This year I picked Raku, formerly known as Perl 6.

my @l = 'aoc-expenses.txt'.IO.lines;

# part 1
say [*] @l.combinations(2).first: *.sum == 2020;

# part 2
say [*] @l.combinations(3).first: *.sum == 2020;
Enter fullscreen mode Exit fullscreen mode

Notable features: