Advent of Code 2022 Day 6 (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 6 of the Advent of Code - https://adventofcode.com/2022/day/6
- Labels:
- Advent of Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AkimasaKajitani neat solve! It reminded me of @AdamR_AYX 's solve from weekly challenge 59 about anagrams. I think you could apply similar logic here:
- 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
Tool golf edition. 2 tools each for parts 1 and 2, with just changing the number of characters to evaluate from 4 to 14. All of the processing can be done with a Generate Rows tool, and then a sample tool for the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'll be honest this was a very lazy solution on my end (which I'm blaming on being ill). I initially used a multi row formula for star 1 and not wanting to do the same for star 2 I built a macro that works in essentially the same way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@estherb47 Cool RegEx solution! I wanted to write like this but I can't write like such a complex one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is the simplest regex I can think of for this. My 1st attempt was clunky with multirow formulas to get the stars. This is better I think.
- 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
Wish I hadn't gotten such a late start on this one - it was a nice pick-me-up after Day 5! Excited to tool golf this one - I already have several ideas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Back to a more gentle challenge today - but still a good excuse to learn some regex from some of our friends.
Dirty solution attached - pending refactor.
This solution's only redeeming feature is that it is parameterised rather than hard-coded into formulae - so the one answer will work for both parts.
What this does is to
- generate a different starting pointer for each possible combination.
- Then creates the window text string for that number of characters
- Then splits them into lines (one character per line)
- And checks if the count of characters for that starting position = the distinct count (i.e. if there are duplicates)
- And it picks the row with the lowest starting position which meets the condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Setting aside Day 5 problem...
Here's my solution for Day 6.
Thanks to Unique tool, it looks more scaleble.😀
![](/skins/images/6056C79A596CAB15526D64C598622101/responsive_peak/images/icon_anonymous_message.png)