AoC 2022 D3: Rucksack Reorganization
| Problem statement | Source code | Tags: Data structures
← Previous Back to AoC Index Next →
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.