Discussion thread for day 10 of the Advent of Code - https://adventofcode.com/2025/day/10
I managed to solve it, but I'll think of another method later.
This works, but is in no way optimised.
I'll have to come back to part 2 later
I think I'm probably reorganising the data too many times, but this gets a correct (but slow) answer.
After not sleeping at all while working on an alternate Part 2 solve, posting this here in the meantime... will continue to delve into an alternate solve once I'm ever able to get some sleep...
Interested to see the first non-optimization solve what is really a classic linear programming problem.
I did something even worse than that because work reasons prohibit me from having predictive tools, so I built something to set up the optimization problem in Alteryx and then dumped to another LP tool.
For those of you joining for the first time this year, we usually get about one of these a year where the problem is not well suited for Base A and we learn by trying to hack rather than by doing things the "right" way. Be not discouraged and note that the posts before this one are some of the folks who are best at this hitting that same wall.
Day 10 presented quite a challenging problem.
For Part 1, I struggled considerably with how to structure the data, but ultimately, I converted it to a vertical format for processing. I suspect it might be possible to solve it more elegantly using tools like Regex.
Part 2 was tackled using an Optimization Tool, which took about 10 minutes to run. I couldn't come up with a solution without relying on the Optimization Tool, so I'm keen to learn from others' workflows to discover alternative approaches.<P1 Macro><P2 Macro>
Same issue as everyone else with Part 2. Works fine for the test data, tried optimising a few ways but grinding slowly. Looking at the numbers I think there's a chance it'd run overnight.Edit: Reader, it did not 😂
Part 1 Macro: A bit of a blunt force approach. Set the light to on or off for all button combinations and repeat until one matches for that puzzle. Main issue here was figuring out what data I needed for the iteration.
Part 2 macro:Initial build stopped after about 4 iterations due to liberal use of generating rows and summarising. Good lesson learned there. Solution works fine for the test data, does progress at a snails pace through the real data so am tempted to leave it running overnight, although I'll be interested to see if someone comes up with any clever solutions which don't use the magic optimisation box 😁I need to upgrade my Alteryx to 2024 or later as FindNth formula would have made my formulas a whole lot easier and I could just check the strings against each other rather than having to split into multiple columns. Still quicker than splitting into rows and summarising though.
Spent a while working with @Goddenra 's Part 2 macro from the post below.
I believe it is a valid solution, if we ignore execution time.
I was able to get the macro about 50% faster (attached.) Which sounds like a lot but wow is that not anywhere close to enough. It can solve easy to medium individual machines but trying to do big ones, much less all of them at once, is a path to out of memory.
Reasonably confident that if there is an answer down this path it comes from some novel way to prune branches rather than just testing each one faster.
For Random extra fun I can't package (zip) the workflow. Throws an error about the Macro being created in a newer version and unlike when I'm opening it to work I can't just click through.
Since @AkimasaKajitani @DaisukeTsuchiya and @Hub119 said it is acceptable to use Optimizaton tool, I will listen.
Day 10 'complete'. Wow, just... wow. This was an insane problem! My Alteryx skills were stretched to the absolute maximum on this one.
Part 1 and 2 Flows
Part 1 Macro
Inner:
Part 2 Macro:
My Reflection:
Day 10
P2
Optimize tool!
Part1 macro
Part 2 macro
Later, I would like to solve on Pure Base A.
I think the R tool, Python tool and Run command tool are obviously restricted in Base A.
It's true that the Optimization tool is an R-based tool. However, I think the imporant thing is that R, Python and Run Command tool allow free programming. The R-based tool merely provides a specific function for Alteryx Designer (how that tool is implemented is solely a matter of Alteryx).
However, it is free not to use R-based tool. I would like to call it as Pur Base A. That way makes AoC much more difficult to solve, but also much more rewarding🎉
Have rebuilt my Part 2 to use the Optimization tool. Good learning experience for me as not used it before. Very quick and dirty generation of the required format, but I was learning as I went.
I was expecting it to keep getting tougher, but this was certainly a step up. Took a couple of long nights, but finally got a solution to part two without using the optimise tool! I will post more of a write-up & neater workflow at a later date, but here's my (relatively) raw solution. Total run time for parts one and two is just under 1 minute in the workflow's current state. A big shout out to @Hub119, I did download your optimise tool solution so that I had a target "button presses per machine", I don't think I would have arrived at my own solution without this.
And Now.... The moment that a couple people may have been waiting for.... a pure base-A solution to Day 10 Parts 1 & 2. This problem was brutal. I don't think I could have solved this without looking at other's code based solutions to learn that many struggled (outside of Alteryx users), and there were no sneaky insights that could solve this problem. There are certainly optimizations that I made use of to solve that several users mentioned on the Reddit AoC Solutions page.
This was remarkably difficult but so satisfying to finally solve. From a workflow that took over 4 hours to solve the smaller cases (up to 9 buttons) and would have destroyed my computer in attempting to solve the entire thing, to a workflow that gave me an answer in 1 minutes and 30 seconds, and I finished before Day 12 released to end this year's AoC!
Happy Solving, for the final time this AoC (This is my last AoC solution post for 2025)!
Part2 is not yet done but for just getting Community Budge, I wanna upload mine for part1.
I still pursue how to crack it without the Optimization tool for my skill-up, it would be carry over to year 2026 though.
Part1 first.a very good example to use/learn Binary formula (or so call bitmask (?)), where know as fastest operator.
Part2, No license for Optimization tool Orz.Take forever with P1 methods. (even just 1st records)
At the end, I was able to solve part2 without the Optimization tool, but it took 2 hours running. 2 hours might sound too long, however, if you already tried part2 without the Optimization tool, you know "finishing calculation" itself is still worth enough, I believe.
Anyway, I did it, and completed AoC2025.
Found a post in Reddit Post
I just converted it to alteryx. It take me 3 hours for finished it. with runtime of 15 Seconds~ 🎉
Relied on reading Reddit and other solutions to solve part 1. Loved the clean solution with binary provided by @AncientPandaman , and that's the approach I took as well.
Haven't started part 2 yet, so posting here for badge credit
Pt1 already too traumatic! 10 minutes to get to the macro end =/
was