Advent of Code 2022 - Day 3Rucksack Reorganization
| Problem statement | Source code | Tags: Data structures
Part 1
I convert the two halves of each string into sets and find the intersection.
Part 2
I made a little utility called chunksOf to split the input into chunks of 3.
Now I can find the common item in each chunk of 3 rucksacks the same way as in part 1.