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')
PHP
My first full-time job was mostly PHP, and since that was in the noughties, I wanted to see what had changed. Not enough! It's still very inconsistent, although the new features do take some of the pain away.
Unfortunately, I found the new pipe operator to frequently involve enough boilerplate that it was cleaner not to bother, .e.g
$x |> (fn($s) => str_replace(" ", "-", $s)). NerdFont's triangle ligature is quite satisfying, at least!Going from p1 to p2 meant looking at 69773 -> 193909310 candidate squares, although I'm sure there's simple optimisations to be made. 2.3 secs to run, so I wasn't waiting around.