Picking garbages in groups
In today’s post, I will describe my solution to Advent of Code year 2017, day 9’s challenge. Let’s read the challenge description before the explanation. Part 1 Part 1 of the problem expects us to report the total number of groups, as collected from the stream of characters. The rules are simple: { marks the beginning of the group unless that’s found in the garbage } marks the end of the group unless that’s found in the garbage First group encounter will have the level of 1, nested groups will have their levels as their depth, as an example, the innermost group of {{{}}} will have level of 3. Groups are separated by commas. Now that is the easy part, let’s get to the garbage. ...