Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
275 B · 15 lines
at rust
12345678910111213141516#!/usr/bin/env perl6use v6;
my @ids = 'input.txt'.IO.lines;
my $twos = 0;my $threes = 0;
for @ids { my %counts = reduce({ $^a{$^b}++; $^a }, Hash.new, |.comb); $twos++ if 2 ∈ %counts.values; $threes++ if 3 ∈ %counts.values;}
say "Part 1: {$twos * $threes}";