Advent of Code 2024 Day 4 (BaseA Style)
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Alteryx Community Team
‎12-03-2024
09:07 PM
- 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:
- Labels:
- Advent of Code
60 REPLIES 60
binuacs
21 - Polaris
‎12-04-2024
03:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
matthewblandford
8 - Asteroid
‎12-04-2024
04:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
realdaniel1989
8 - Asteroid
‎12-04-2024
07:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Malvim
11 - Bolide
‎12-04-2024
10:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
17 - Castor
‎12-05-2024
01:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I liked this one - took a little time to carve out a spot to work on it, but it was enjoyable (a little geometric thinking)
Spoiler
Approach:
create a rowID; a column ID; a diagnal 1 & 2 ID (for the two diagonal directions). this way you can group them into strings
- To create the diags - it's worth knowing that on the one diag, x+y =c; and on the other x-y = c
Then you just take these groups and look for the relevant strings
For part 2 - if you know which letter in the string is the A, you can do a simple join to find X shapes - and then just count.

Python solution to follow.
Code is stored here: SeanAdams10/AdventOfCodePython: Advent of code challenges in Python - across multiple years
create a rowID; a column ID; a diagnal 1 & 2 ID (for the two diagonal directions). this way you can group them into strings
- To create the diags - it's worth knowing that on the one diag, x+y =c; and on the other x-y = c
Then you just take these groups and look for the relevant strings
For part 2 - if you know which letter in the string is the A, you can do a simple join to find X shapes - and then just count.
Python solution to follow.
Code is stored here: SeanAdams10/AdventOfCodePython: Advent of code challenges in Python - across multiple years
17 - Castor
‎12-05-2024
01:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
:-) it's great to see the progression of thinking as you refined this @CoG
17 - Castor
‎12-05-2024
01:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Agree with you @NicoleJ - the record ID with grouping really is a great addition - I expect the tile tool to get very very lonely now.
Tokimatsu
12 - Quasar
‎12-05-2024
03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Very slow. I may brash up this.
Spoiler
 
Bobbyt23
12 - Quasar
‎12-05-2024
03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
IgorL
6 - Meteoroid
‎12-05-2024
04:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Took me way too long to realize I was counting diagonals in only one direction 😅
Spoiler
Record ID and Tile can be used to get the coordinates for each letter, simple formula to group letters into diagonals. Concatenate base on each coordinate to get all possible strings and parse for results.
For part 2, parse each set of diagonals for MAS/SAM then join based on coordinates to find overlaps.
For part 2, parse each set of diagonals for MAS/SAM then join based on coordinates to find overlaps.
