Discussion thread for day 1 of the Advent of Code - https://adventofcode.com/2025/day/1
First time ever participating in AoC and it did not disappoint. I was able to solve for the first task pretty quickly, however, when I went to reference that work for task two, I found a flaw in my logic that, interestingly enough, it still produced the right answer.
Problem was, it didn’t help me with task two. So, I re-tooled that part and moved on to task two.
…and wrong-answer-jail for 5min…
Kept at it and got the answer on my next attempt!
Solution and explanation below:
Workflow:
Narrative:
Okay so Task 1: Since we know the dial has 99 values + zero, it’s 100 values, which makes for nice division; however the MOD() function also works to help repeat the values on a base 100 scale.
Computing the Dial Location is where I got lucky on my first task and still got the right answer despite flawed logic. I was computing the location of the zero’s just fine, but I wasn’t actually showing the correct dial location. When 5 went left by 15, I was showing a -10 (or 10 with absolute value) instead of the correct value of 90…
A quick change to the formula produced: IF Mod([Delta], 100) >= 0 THEN Mod([Delta], 100) ELSE 100 - Abs(Mod([Delta], 100)) ENDIF
Filter down to zero’s and sum ‘em up.
Task 2: This is where I noticed the issue with task 1, but now that I have a working Dial Location, I could break this into three section:
The reason for the three, is my method subtracts the movement from 100, but when it’s starting at zero, it needs to see that as “100” and not “0”.
Apply the FLOOR() function and now I can see how many times it crosses 1 when divided by 100. Why I chose MOD() for T1 and dividing by 100 for T2 is anyone’s guess.
The Multi-Row-Formula Tool was my friend for both Tasks, but here is my logic for Task 2 before counting occurrences for the solution:
IF [Direction] = "S" THEN 0
ELSEIF [Direction] = "R" THEN Floor(([Row-1:Dial Location] + [Clicks]) / 100)
ELSEIF [Direction] = "L" AND [Row-1:Dial Location] = 0 THEN Floor((([Row-1:Dial Location]) + [Clicks]) / 100)
ELSEIF [Direction] = "L" THEN Floor(((100 - [Row-1:Dial Location]) + [Clicks]) / 100)
ELSE NULL()
ENDIF
Phew okay, now that we’re through day 1, I anticipate the difficulty to start ramping up. Cheers and on to day 2… hopefully.
-Jay
It seemed too easy, maybe because I added 50 as the first line of the input file? I'm uploading before I look at other solutions so I'm not tempted to make mine more efficient :)
Did anyone also code this? I wonder how much more efficient Alteryx is. I think this took about 15 minutes total.
I stashed pretty much everything into formula tools except for the multi-row formula, which does the majority of the heavy lifting with respect to seeing where each rotation lands. Modulus was a huge lifesaver for me, in a number of ways!
This was my first ever Advent of Code challenge! I have been looking forward to this challenge since I heard about it so I am happy to be 1/1 to start the month. Happy December!
Multi-Row and Generate Rows Tools to the rescue!
It's that time of year again!
I'm both happy and sad that there are fewer problems.
Even though it was the first day, I had quite a bit of trouble.
The workflow is simple, but part two took quite a bit of trial and error.
Even when exceeding 100, the R-side calculation remained straightforward. However, when L exceeded 100, or when it started at 0 or ended at 0, incorrect calculations frequently occurred.
Therefore, for cases where L was greater than 0, I adjusted the start position to (100 - start position) and calculated it the same way as R. Also, even if L was involved, when the start was 0, I used the same calculation as R.
I believe there are better approaches, so I look forward to seeing everyone's solutions.
