I can't code today because of travel, just as the one that might run slow enough to geek out on benchmarking the various options. Does seem like it's a bit of a jump in difficulty from previous days.
Advent Of Code
An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Everybody Codes is another collection of programming puzzles with seasonal events.
EC 2025
AoC 2025
Solution Threads
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 |
Rules/Guidelines
- Follow the programming.dev instance rules
- Keep all content related to advent of code in some way
- If what youre posting relates to a day, put in brackets the year and then day number in front of the post title (e.g. [2024 Day 10])
- When an event is running, keep solutions in the solution megathread to avoid the community getting spammed with posts
Relevant Communities
Relevant Links
Credits
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
Based on the slow trickle of results pt2 was very hard. But, having now got a good result, its not that difficult, but getting to that solution/algorithm took a lot of brain power.
I hope todays is a little bit more relaxed.
wish not granted
Yeah, today is rough as well. I guess I jinxed it.
Based on the star distribution today (everyone who has solved part 1 also solved part2) I suspect at least part 2 is easy even if I can't make a dent on part1 yet
It was ~~easy~~ staight forward brtue force:
Spoiler
For each possible_rectange Find Max:
If polygon.contains(rectangle) Then rectangle.area() Else 0
For speed the loop can be run paralelley.
I had no time to implent the contains myself, but pretty much all languages have a library already.
yea becomes trivial if one uses a polygon library (I did too) but looking at the actual polygon, one can cook up some clever heuristics to do it quite quickly with some basic checks I think.
I'll check if someone created a guide for the clever solution, cos I'm interested. But I don't have nearly enough knowledge about geometry to came up with one myshelf. (nor energy after the 10 hour workdays in the last two weeks..)