AoC 2022 D6: Tuning Trouble
| Problem statement | Source code | Tags: Data structures
← Previous Back to AoC Index Next →
Part 1
TBH this feels more like a day 1 problem. I just need to iterate through the string, taking substrings of length 4. I use a Set to deduplicate the characters, and if we still have 4 characters, then they are all unique.
Part 2
Same as part 1, but with length 14 instead of 4. I parameterize roll over the length of the marker.