This is a thread to discuss Day 6
https://adventofcode.com/2023/day/6
REMEMBER!
It is VERY important NOT to write any public spoilers ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
ALWAYS keep spoiler stuff hidden inside one of these
Summary
This text will be hidden
which you can obtain by clicking on the gear icon
![image](https://cdn.forum.snap.berkeley.edu/original/2X/8/83dd1d2da37c061226dad8b305769df5a7be3093.png)
Good luck ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
FYI one of the features of Advent of Code is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve
Who decided the time would be measured in milliseconds? That is no time at all, and you'd need to be very precise about the amount of time held pressing a button.
Alright the realism rant is over, now it's time to actually give my solution.
Part 1
I took a different approach to finding the solution this time. I noticed a pattern, and thought about it in a mathematical way. It just looks for the minimum number of milliseconds held, then it just finds the max by doing
((total - (min) * 2) - 1))
I've got back on the horse after giving Day 5 a miss and I found Part 1 relatively easy ![:slight_smile: :slight_smile:](https://forum.snap.berkeley.edu/images/emoji/apple/slight_smile.png?v=12)
And I even managed to use Pipe correctly
Part 1 scripts
![aoc23Day6 script pic](https://cdn.forum.snap.berkeley.edu/original/3X/2/3/23a158919dd72ad213105ee4cf91403a79fc9a2f.png)
Managed to do Part 2 but browser locked up when saving
but here are my 2 gold stars to prove it
![image](https://cdn.forum.snap.berkeley.edu/original/3X/a/2/a24cdfe01eb415f113e7b915b0f25491a38d0d70.png)
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc23Day6