23
๐ฌ - 2026 DAY 3 SOLUTIONS - ๐ฌ
(programming.dev)
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.
Solution Threads
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
Kotlin
Part 1 was simple enough, for every node, check to the bottom and right in equal distance if nodes are found there, then search for the fourth node at
r + offsetandc + offset. Initially I was scared this would take long, but it runs instantly so good enough for me.It's only day 3 and I already took over 24 h for part 2โฆ Not proud, takes roughly 5 seconds to run, looks horrible, but works:
For every node, draw vectors to all nodes "beneath" it (lower rows), then find orthogonal pairs, and for each pair search for the fourth point again. I'm actually reasonably happy with the idea, I assume if you implement this better it may be pretty fast too.
Solution
full code on Codeberg