Not sure where @RedNose is so I'll just post this. Post ur solutions below or whatever idc
Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!
Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app
What did you think about today's problem?
Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)
Jump in the discussion.
No email address required.
The input parsing is really bloating my code. Much easier than yesterday and part2 runs fast enough(2s) that I am wont bother doing fancy math.
Jump in the discussion.
No email address required.
I stored each win and how long you'd to hold down the button separately before, thinking that might become useful in part 2, it didn't. If I remove this and instead just count how often you win (and actually enable release mode), i am down to 29ms.
Jump in the discussion.
No email address required.
More options
Context
jfc why do people use C++? input parsing in JS is really ez:
repeat for the distances and you are done.
Jump in the discussion.
No email address required.
Agreed that it's a shit language but it could be written more tersely.
For parsing you could do this:
And that's not even using the more modern features of cpp 20.
The full solution ends up not that far off from other compiled languages:
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context