Discussion thread for day 10 of the Advent of Code : https://adventofcode.com/2020/day/10
This was much less of a programming problem and more of a maths problem. And **bleep** all of my UK friends for making me add the s to math! Anyway - super fun problem.
A little hint that isn't obvious at all looking at it at all - there is binary involved again!
Non macro solution. Thanks @jdunkerley79 for the hint to part 2.
Continuing with my Amp exploration from yesterday, this solution runs slower in the Amp engine(0.8s) vs the original(0.3s). It probably has to do with the trade off between the overhead in analyzing the workflow for parallel processing and the speed increase gained. Since there are very few rows in the input data, the overhead vastly outweighs the performance gains. To investigate this more, I added a generate rows tool to the start to see where potential performance gains begin. In this very linear workflow, AMP starts to show benefits once the input consists of about 3.5M rows.
Dan
Couldn't have done this without your hints, @jdunkerley79. I knew there had to be a pattern but was having a hard time spotting it... I did mock it up after reading your suggestion, however, just to prove it out to myself... you're a wizard, my friend.
Cheers!
NJ
[deleted]
apols for duplicating my post, need to make sure I'm on the right account, see below for my answer.
I got a nice little use out of the tile tool there and [edit] some janky maths that doesn't hold for higher numbers now I've read the reddit thread. 😅
I've now supersimplified it with a conditional Tribonacci
This took me back to math theory and patterns from college. What was hanging me up on part b is I was trying to apply the pattern below "1113" (count ones = 3). At and above that it is:
@Balders Nice use of the tile tool, I could have replaced 2 multi rows with 1 tile in my workflow.