This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Today was the first day that I gave up getting up at 5 am and tried the challenge with a good night's sleep. Before tackling the problem, I looked at the stats of the fastest solvers and saw, that the best approaches from the speed kings range between 1-3h. When reading the problem, I realized what they must have done and decided: Let's go simple. No double iterative macros, no iterative / batch combination. Let's analyze the problem and go for just one iterative - but very manual - non-scaling macro. I will go to hell for it and will definitely come back to it in the future and go for the double iterative + batch macro solution - I simply wasn't in the mood today and treated it like a one-time consulting question: You need to get the answer, no matter how and you need it fast.
Part 2 I think similar to everyone, I tried to simply increase the data type for part 2 to Int64 and afterward to FixedDecimal 50.0. Obviously, it failed, but it was worth a try. When thinking about it more carefully, I thought about last year: It had to be a mathematical solution, and there had to be a clever way to do it. I did the first iteration for the Monkey 0 on paper and simplified the problem. I spend roughly ten minutes trying an approach that would get rid of my part 1 macro entirely and replace it with a single formula but realized, I'm not JB and still not fully up. Attempt 2 was more successful and required only smaller changes to my part 1 macro - so small, that the whole macro is still exactly the same on the screenshot. For everyone working on part 2 and looking for help here: Take the sample they provide and work through it on paper and look for a mathematical pattern.
In part 2, it took about 3 minutes for 10,000 loops(certainly, the number of loops is 8 x 10,000 = 80,000 loops). But the time that took the best ratio is how to solve the overflow problem. As a result, I read the reddit and then finally I went to the route using LCM. And also, I mistook the number of monkey in the inner macro... I missed that I set the number of the loop directly.
I initially misunderstood the question's counting mechanism but eventually figured out my mistake(s).
Otherwise, part 1 is not too difficult.
For part 2, I did not realise at first that there was an overflow issue and even went so far as to built and Excel simulator to debug my workflows. Once figured out that it was an overflow issue, then I solved it with a mathematical formula (hint: Smallest Common Multiplier) to reduce the dimension.
My solution involves using 2 iterative macros. On my laptop, it takes ~10min to run... and we are only D11...😂
To oversimplify, I just used my normal solve and used the VarNum and VarText functions to read and write the data in certain spots. The Generate Rows is pretty cool, it's condition expression is actually being updated in the next formula tool. The VarNum/VarText actually allow data to flow backwards (in a sense).
Generate Rows (It's reading a variable that is being update in the following formula tool).