Advent of Code 2024 Day 4 (BaseA Style)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2024/day/4
- Labels:
- Advent of Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Whoo! I enjoyed this tremendously. I will include a more thorough explanation for my approach below later (in the form of a YouTube video), but for now here is my solution.
Solution Screenshot (Updated to Simplify):
Tool Golf V3 Solution (10 Tools per Part):
Tool Golf V4 (Part 1: 6 Tools, Part 2: 7 Tools):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That was a really neat one. Similar to some of the harder ones last year, but with fewer complications. Part 2 seemed easier than Part 1, though that could just be having done Part 1 first. Interesting to see the different ways people deal with this.
Sharing file this time because it's pretty and I like the solution. Those have not both been true on previous days.
I think I could have left out the filter to throw out out-of-bounds values and let the joins do that but that's the sort of thing that causes errors in harder problems so I like to keep up good habits. Conversely, hard coding the maximum row/column count is a terrible habit that we allow as a concession to speed. In a production world this would be join with count of rows and filter on row<=Maxrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
have to use macro this time. diagonal is hard to do without macro
and luckily I save some macro last few years. like split to x and y. and generate the adjacent location.
it save some time to re-build it.
part2: easier than part1, haha.
filter for data value "A", get adjacent, check the diagonal values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This one was a fun challenge! There's a lot of sloppy design in this first pass, but I'm excited to clean up the logic later this week.
Eager to clean up the macro so that I can use a single macro for both parts. I also want to see if I can use Regex to count matches in the diagonals, but I'll need some sleep before I work that out!
I took the lazy way out and set my max iterations to the size of the data. NOT best practice, but it worked for me to get a faster answer, so I went with it for now.
This is one of my multi-row formulas. I used each to look at diagonals going different directions. In hindsight, I don't know that I need all 4, so that's another thing I'll look at tomorrow.
Substring([data],[Engine.IterationNumber],1)+
SubString([Row-1:data],[Engine.IterationNumber]+1,1)+
Substring([Row-2:data],[Engine.IterationNumber]+2,1)+
SubString([Row-3:data],[Engine.IterationNumber]+3,1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It's challenges like these that make me wish I had an index listing all the things I've built in the previous Advent of Code years to solve the same exact thing... "Alexa, tell me how I solved this 'find the coordinates' problem the last 20 times it's come up in Advent of Code..."
Today's "new Designer features in action" shout-outs: Dark Mode (because I didn't get enough sleep last night getting stuck on Day 3 Part 2, so my eyes already hurt), and Group By in the Record ID tool! ❤️
NJ
Sr. Manager, Product Management, Designer
Alteryx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Okay, time for bed. *NOTE: made some tweaks today and reposted so my solution is more clearly labeled and easier to follow (that seems to go out the window at 1 in the morning...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My solution! This is messy.
Today it took a long time because I was away for 20-30 minutes in the middle of Part 2. I don't like diagonal...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
