4 ms·
While I agree four minutes is very quick, if you take into account that no side fits with more than one other side, and that the sides (#, .) may just as well b
by yesbabyyes 5y ago
While I agree four minutes is very quick, if you take into account that no side fits with more than one other side, and that the sides (#, .) may just as well be interpreted as binary numbers, it becomes an issue of parsing, mostly, and then matching numbers.
I remember being flabbergasted at first, and then realizing the above. My solution is here:
https://github.com/linus/aoc/blob/main/2020/js/day-20/app.js https://github.com/linus/aoc/blob/main/2020/js/day-20/app.js
- oceliker 5y agoSo it turns out I missed those parts of the problem statement. That makes it fairly easy. I probably still can't write working code for that in four minutes, but it does sound humanly possible, at least. Also, that's really nicely written code :)