
Spoiler - Day 16 Part 2

I come up with a linear solution for the problem but it is heck slow!

@sorawee what is the complexity of your solution?

I am not using the fact that I have to skip some positions. Let me think more about it.

Way faster using this information. :D

My part 1 is slow — O(n^2), but part 2 is not that slow — O(n)

$ time raco aoc run task-1
raco aoc run task-1 26.20s user 0.63s system 98% cpu 27.325 total
$ time raco aoc run task-2
raco aoc run task-2 6.36s user 0.92s system 95% cpu 7.593 total

It took me much too long to solve Day 10 part two. My approach was correct, but I didn’t test the small pieces.

The problem writer is so creative! Today was really fun.

Agreed, though I spent too much time on stupid thing. I didn’t read carefully and was confused that it doesn’t output an answer but instead a bunch of numbers (and I was too lazy to convert them to ascii). Turns out it asked about continuous video feed thing and I didn’t answer that. Took me a lot of time to eventually realize it…

I wish the output sequence is longer though, so that it forces people to programmatically solve it. Right now it’s too short and you can solve it manually.