This is the day three challenge for Advent of Code 2024 and the challenge is called Mull It Over Advent of Code: adventofcode.com/ GitHub Repo: github.com/jos... Playlist: • Advent of Code 2024 Go
Пікірлер: 6
@benitoe.48782 ай бұрын
Did it in Go as well. My solution is a mile long. Thanks for this one.
@jori46982 ай бұрын
took me 1 hour for the part 2. Just awesome how you handled it with your regex. I made 3 different regexes but your solution is way more elegant. love it!
@josh_ackland2 ай бұрын
If I did 3 different regexs I'd have no idea how to get them in order :D
@PravobzenАй бұрын
@@josh_ackland I tried with three regex's, but it was a mess of trying to iterate through the indexes and doing conditional statements. I was able to modify your solution to a switch statement to then returned the filtered matches: enabled := true for _, match := range matches { switch match[0] { case "do()": enabled = true case "don't()": enabled = false default: if enabled { filteredData = append(filteredData, match) } } }