wanderley.guimaraes
2019-12-16 17:35:11

Spoiler - Day 16 Part 2


wanderley.guimaraes
2019-12-16 17:36:11

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


wanderley.guimaraes
2019-12-16 17:36:34

@sorawee what is the complexity of your solution?


wanderley.guimaraes
2019-12-16 19:12:22

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


wanderley.guimaraes
2019-12-16 19:49:20

Way faster using this information. :D


sorawee
2019-12-16 23:14:00

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


sorawee
2019-12-16 23:14:11

$ 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


samdphillips
2019-12-17 00:46:53

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


wanderley.guimaraes
2019-12-17 07:10:01

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


sorawee
2019-12-17 07:31:02

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…


sorawee
2019-12-17 07:32:45

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.