I really tried maintaining a pointer but I was jus...
# advent-of-code
t
I really tried maintaining a pointer but I was just getting confused and off by one and just figured this was easier for me. Might be slower.
a
Nice solution, tried a LinkedList but Part 2 seemed to take forever. In the end I used an ArrayDeque as it is backed by an array rather than a list. Was much quicker (~1 sec for part2)
t
Part 2 with this took me 2.2s.
I guess a Deque is faster. I honestly didn't think to try that, I never remember it is there.
a
2.2s is impressive, my original solution was gone for minutes.
t
Yeah, I got tired of waiting for the MutableList version, so I reverted to LinkedList. 🙂