A few of the Tangram Flex Engineers have been participating in this years Advent of Code (adventofcode.com). This topic will be a place where anyone can discuss the problems and share interesting strategies. Please refrain from sharing solutions directly as we don’t want to spoil the puzzle for anyone just looking for help. Pasting a link to a gitlab repo is fine. Good luck!
Day 10 of Advent of Code was a real treat. Part 1 was deceptively easy as part 2, while easy to solve, the standard solution is “combinatorially explosive” The function did not return after about 10 minutes, though I am sure it would have. A fellow engineer pointed me to memoization as way to speed things up. This was the first time I have used it and the results were surprising. Memoization is storing the results of an algorithms sub problems so as to not repeat the calculations. This worked exceptionally well with my recursive solution. TIL: Memoization
I have really been enjoying the problems so far this yea. I’m doing them in clojure as an attempt to learn the language. My only other prior experience with the language is from doing advent of code last year, which I only made to day 10. Hoping to make it further this year but ive fallen a few days behind. Its definitely been an interesting experience using clojure as I am not super familiar with lisp syntax, but its always fun trying to learn a new language.
I have been tracking my solutions on github here: https://github.com/listba/advent-of-code-2020/
Day 11, may we never think more about day 11. Quite a challenging problem in that there are many edge cases to keep track of, this becomes even more apparent in part 2. A few lessons learned here is that it helps to start with smaller problems and individual cases to exercise each sub problem within the large problem. I could have saved myself some trouble by developing some test cases and some testing infrastructure. Exercising specific cases was a bit of a struggle later on. Especially pay attention to the rules and ensure you are implementing the logic correctly. Glad this one is over, but am interested in lessons from others who have participated in this puzzle.