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 1say[*]@l.combinations(2).first:*.sum==2020;# part 2say[*]@l.combinations(3).first:*.sum==2020;
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.
Notable features:
[ ]
with the*
operation for getting the final product.