This problem was similar to the Marble Game on day 9, so I started with a solution similar to the one I used for that problem, using a linked list and having the two elves as linked list nodes that can move along the list. It worked fine for the first part of the problem, but started running pretty slow for the second part of the problem.
Day 14: Chocolate Charts
· One min read